import request from '@/utils/request'
// import axios from 'axios'
import API from './constants'
/*
    获取所有分类数据 顶部导航栏
*/
export const getCategories = () => {
  return request({
    url: API.TABS_API,
    methods: 'get'
  })
}

export const getSubCategories = (id) => {
  return request({
    url: API.TAB_API + '/' + id,
    methods: 'get' // 可不写 默认为get请求
  })
}

export const getBanners = () => request({
  url: API.BANNER_API,
  headers: {
    'x-platform': 'pc'
  }
})

export const getBaoKuan = (start = 0) => {
  return request({
    url: API.BAOKUAN_API,
    methods: 'get',
    params: {
      start
    }
  })
}
